package com.rent.appointment.dto;

import com.rent.appointment.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

@ApiModel(value = "预约信息")
@Data
public class ApplyViewDto implements Serializable {
    @ApiModelProperty(name = "id",value = "ID",
             required = false)
    @NotNull(groups = UpdateGroup.class,message = "ID不能为空！")
    private Long id;

    @ApiModelProperty(name = "userId",value = "用户ID",
            required = false)
    @NotNull(message = "用户ID不能为空！")
    private Long userId;

    @ApiModelProperty(name = "houseId",value = "住房ID",
            required = true)
    @NotNull(message = "住房ID不能为空！")
    private Long houseId;

    @ApiModelProperty(name = "landlordId",value = "房东ID",
            required = false)
    @NotNull(message = "房东ID不能为空！")
    private Long landlordId;

    @ApiModelProperty(name = "appointmentTime",value = "预约时间",
            required = false)
    private Date appointmentTime;

    @ApiModelProperty(name = "contactPhone",value = "联系电话",
            required = false)
    @Pattern(regexp = "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$",message = "手机格式不合法！")
    private String contactPhone;

    @ApiModelProperty(name = "remark",value = "评论",
            required = false)
    private String remark;

    @ApiModelProperty(name = "status",value = "处理状态")
    @Range(max = 3,min = 0,message = "必须大于等于0或小于等于3！")
    private Integer status; // 0-待处理，1-已同意，2-已拒绝，3-已取消

    @ApiModelProperty(name = "handleTime",value = "处理时间",
            required = false)
    private Date handleTime;

    @ApiModelProperty(name = "handleRemark",value = "处理评论",
            required = false)
    private String handleRemark;

}
